package cn.funnyxb.powerremember.pullMsg;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import cn.funnyxb.powerremember.pullMsg.beans.AppConfig;
import cn.funnyxb.powerremember.pullMsg.beans.VersionInfo;
import cn.funnyxb.powerremember.pullMsg.beans.WebMsg;
import cn.funnyxb.tools.appFrame.debugTool.Debuger;
import cn.funnyxb.tools.appFrame.util.ManifestMetaData;
import cn.funnyxb.tools.appFrame.util.net.NetHelper_Adv;
import cn.funnyxb.tools.appFrame.util.net.exceptions.Exception_ActiveConnectionIsNotAvailable;
import cn.funnyxb.tools.appFrame.util.net.exceptions.Exception_CannotGetConnectionSource;
import cn.funnyxb.tools.appFrame.util.net.exceptions.Exception_ResponseCodeIsNot200;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.HashMap;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;

public class ServerMsger
{
  private static final String xmlFile_appConfig = "config.xml";
  private static final String xmlFile_version = "version.xml";
  private static final String xmlFile_webmsg = "webmsg.xml";
  private Context context;

  public ServerMsger(Context paramContext)
  {
    this.context = paramContext;
  }

  private String getThisVersionFullXmlFileUrlEndWithSeparator()
  {
    int i;
    String str1;
    try
    {
      i = this.context.getPackageManager().getPackageInfo(this.context.getPackageName(), 1).versionCode;
      if (i >= 0)
        break label40;
      str1 = null;
      label28: label40: return str1;
    }
    catch (PackageManager.NameNotFoundException localNameNotFoundException)
    {
      localNameNotFoundException.printStackTrace();
      str1 = null;
      break label28:
      String str2 = ManifestMetaData.getString(this.context, "SubVersionName");
      str1 = "http://www.5ixphone.com/pkg/" + this.context.getPackageName() + "/" + i + "/" + str2 + "/";
    }
  }

  private void log(String paramString)
  {
    Debuger.log("servermsg", paramString);
  }

  public AppConfig getAppConfig()
  {
    String str1 = getThisVersionFullXmlFileUrlEndWithSeparator();
    AppConfig localAppConfig;
    if (str1 == null)
      localAppConfig = null;
    while (true)
    {
      return localAppConfig;
      String str2 = str1 + "config.xml";
      log("urlStr=" + str2);
      try
      {
        log("downAppConfig to call");
        HashMap localHashMap = new NetHelper_Adv(this.context).downLv1Xml2Obj(str2);
        log("downAppConfig after");
        localAppConfig = AppConfig.parseFromHashMap(localHashMap);
      }
      catch (MalformedURLException localMalformedURLException)
      {
        localMalformedURLException.printStackTrace();
        log("loadVersionInfo MalformedURLException ");
        localAppConfig = null;
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
        log("loadVersionInfo IOException");
        localAppConfig = null;
      }
      catch (Exception_CannotGetConnectionSource localException_CannotGetConnectionSource)
      {
        localException_CannotGetConnectionSource.printStackTrace();
        log("sorry loadVersionInfo Exception_CannotGetConnectionSource");
        localAppConfig = null;
      }
      catch (Exception_ActiveConnectionIsNotAvailable localException_ActiveConnectionIsNotAvailable)
      {
        localException_ActiveConnectionIsNotAvailable.printStackTrace();
        log("loadVersionInfo Exception_ActiveConnectionIsNotAvailable");
        localAppConfig = null;
      }
      catch (Exception_ResponseCodeIsNot200 localException_ResponseCodeIsNot200)
      {
        localException_ResponseCodeIsNot200.printStackTrace();
        log("loadVersionInfo Exception_ResponseCodeIsNot200");
        localAppConfig = null;
      }
      catch (ParserConfigurationException localParserConfigurationException)
      {
        localParserConfigurationException.printStackTrace();
        log("loadVersionInfo ParserConfigurationException");
        localAppConfig = null;
      }
      catch (SAXException localSAXException)
      {
        localSAXException.printStackTrace();
        log("loadVersionInfo SAXException");
        localAppConfig = null;
      }
      catch (FactoryConfigurationError localFactoryConfigurationError)
      {
        localFactoryConfigurationError.printStackTrace();
        log("loadVersionInfo FactoryConfigurationError");
        localAppConfig = null;
      }
    }
  }

  public VersionInfo getNewestVersionInfo()
  {
    String str1 = getThisVersionFullXmlFileUrlEndWithSeparator();
    Object localObject;
    if (str1 == null)
      localObject = null;
    while (true)
    {
      return localObject;
      String str2 = str1 + "version.xml";
      try
      {
        log("loadVersionInfo to call");
        HashMap localHashMap = new NetHelper_Adv(this.context).downLv1Xml2Obj(str2);
        log("loadVersionInfo after");
        VersionInfo localVersionInfo = VersionInfo.parseFromHashMap(localHashMap);
        localObject = localVersionInfo;
      }
      catch (MalformedURLException localMalformedURLException)
      {
        localMalformedURLException.printStackTrace();
        log("loadVersionInfo MalformedURLException ");
        localObject = null;
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
        log("loadVersionInfo IOException");
        localObject = null;
      }
      catch (Exception_CannotGetConnectionSource localException_CannotGetConnectionSource)
      {
        localException_CannotGetConnectionSource.printStackTrace();
        log("sorry loadVersionInfo Exception_CannotGetConnectionSource");
        localObject = null;
      }
      catch (Exception_ActiveConnectionIsNotAvailable localException_ActiveConnectionIsNotAvailable)
      {
        localException_ActiveConnectionIsNotAvailable.printStackTrace();
        log("loadVersionInfo Exception_ActiveConnectionIsNotAvailable");
        localObject = null;
      }
      catch (Exception_ResponseCodeIsNot200 localException_ResponseCodeIsNot200)
      {
        localException_ResponseCodeIsNot200.printStackTrace();
        log("loadVersionInfo Exception_ResponseCodeIsNot200");
        localObject = null;
      }
      catch (ParserConfigurationException localParserConfigurationException)
      {
        localParserConfigurationException.printStackTrace();
        log("loadVersionInfo ParserConfigurationException");
        localObject = null;
      }
      catch (SAXException localSAXException)
      {
        localSAXException.printStackTrace();
        log("loadVersionInfo SAXException");
        localObject = null;
      }
      catch (FactoryConfigurationError localFactoryConfigurationError)
      {
        localFactoryConfigurationError.printStackTrace();
        log("loadVersionInfo FactoryConfigurationError");
        localObject = null;
      }
    }
  }

  public WebMsg getWebMsg()
  {
    String str1 = getThisVersionFullXmlFileUrlEndWithSeparator();
    WebMsg localWebMsg;
    if (str1 == null)
      localWebMsg = null;
    while (true)
    {
      return localWebMsg;
      String str2 = str1 + "webmsg.xml";
      try
      {
        log("loadWebMsg to call");
        HashMap localHashMap = new NetHelper_Adv(this.context).downLv1Xml2Obj(str2);
        localWebMsg = WebMsg.parseFromHashMap(localHashMap);
      }
      catch (MalformedURLException localMalformedURLException)
      {
        localMalformedURLException.printStackTrace();
        log("loadWebMsg MalformedURLException ");
        localWebMsg = null;
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
        log("loadWebMsg IOException");
        localWebMsg = null;
      }
      catch (Exception_CannotGetConnectionSource localException_CannotGetConnectionSource)
      {
        localException_CannotGetConnectionSource.printStackTrace();
        log("loadWebMsg Exception_CannotGetConnectionSource");
        localWebMsg = null;
      }
      catch (Exception_ActiveConnectionIsNotAvailable localException_ActiveConnectionIsNotAvailable)
      {
        localException_ActiveConnectionIsNotAvailable.printStackTrace();
        log("loadWebMsg Exception_ActiveConnectionIsNotAvailable");
        localWebMsg = null;
      }
      catch (Exception_ResponseCodeIsNot200 localException_ResponseCodeIsNot200)
      {
        localException_ResponseCodeIsNot200.printStackTrace();
        log("loadWebMsg Exception_ResponseCodeIsNot200");
        localWebMsg = null;
      }
      catch (ParserConfigurationException localParserConfigurationException)
      {
        localParserConfigurationException.printStackTrace();
        log("loadWebMsg ParserConfigurationException");
        localWebMsg = null;
      }
      catch (SAXException localSAXException)
      {
        localSAXException.printStackTrace();
        log("loadWebMsg SAXException");
        localWebMsg = null;
      }
      catch (FactoryConfigurationError localFactoryConfigurationError)
      {
        localFactoryConfigurationError.printStackTrace();
        log("loadWebMsg FactoryConfigurationError");
        localWebMsg = null;
      }
    }
  }
}

/* Location:           E:\Desktop\复件 classes_dex2jar.jar
 * Qualified Name:     cn.funnyxb.powerremember.pullMsg.ServerMsger
 * JD-Core Version:    0.5.3
 */